package com.TaskOrganizer.actions;

import java.net.URL;

import javax.swing.AbstractAction;
import javax.swing.Icon;
import javax.swing.ImageIcon;

public abstract class DefaultAction extends AbstractAction {

	private static final long serialVersionUID = 7009716791192171981L;

	public DefaultAction() {
	}

	public Icon getIcon(String path) {
		URL url = getClass().getResource(path);
		Icon icon = null;
		if (url != null)
			icon = new ImageIcon(url);
		else
			System.err.println("Resource not found: " + path);
		return icon;
	}

}
